package com.bilibili.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.bilibili.dao.RefreshTokenMapper;
import com.bilibili.domain.entity.RefreshToken;
import com.bilibili.service.RefreshTokenService;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;

/**
* @author www
* @description 针对表【t_refresh_token(刷新令牌记录表)】的数据库操作Service实现
* @createDate 2024-06-12 10:37:37
*/
@Service
public class RefreshTokenServiceImpl extends ServiceImpl<RefreshTokenMapper, RefreshToken>
    implements RefreshTokenService {

    @Resource
    private RefreshTokenMapper refreshTokenMapper;

    @Override
    public Integer deleteRefreshToken(String refreshToken, Long userId) {
        return refreshTokenMapper.deleteRefreshToken(refreshToken,userId);
    }

    @Override
    public Integer addRefreshToken(String refreshToken, Long userId, Date date) {
        return refreshTokenMapper.addRefreshToken(refreshToken,userId,date);
    }

    @Override
    public RefreshToken getRefreshTokenDetail(String refreshToken) {
        return refreshTokenMapper.getRefreshTokenDetail(refreshToken);
    }
}




